(function($){
	$(document).ready(function(){
		$('a').focus(function(){$(this).blur();});
		$(':text, :password, textarea').focus(function(){
			$(this).addClass('focus');			
		}).blur(function(){
			$(this).removeClass('focus');
		});
		
		$('.loginbox :text[name=user_login_id]').focus(function(){
			if($(this).val() == '아이디'){$(this).val('');}
			$(this).removeClass('off');
		}).blur(function(){
			if($(this).val() == ''){$(this).val('아이디');$(this).addClass('off');}
		}).blur();

		$('.message_box').click(function(){
			popup('/user/msg',620, 520, 'messagebox');
		});
		$('.user_points').click(function(){
			popup('/user/points',520, 620, 'pointsbox');
		});

		$('#btn_mini_login').click(function(){
			$('#miniLoginForm').submit();
		});
		$('#miniLoginForm>:password').keypress(function(e){
			if(e.keyCode == 13)	$('#btn_mini_login').click();
		});
		$('#btn_logout').click(function(){
			if(confirm('로그아웃 하시겠습니까?'))
			{
				location.href = '/user/logout';
			}
		});
		$('form[name=g_search] a.btn').click(function(){$('form[name=g_search] button').click();});
		$('form[name=g_search] :text').keypress(function(e){if(e.keyCode == 13) $('form[name=g_search] a.btn').click();});
		
		$('.search_keywords span.keyword').click(function(){
			$('form[name=g_search] :text').val($(this).text());
			$('form[name=g_search] a.btn').click();
		});
		
		$('a.userinfo').click(function(){
			userinfo($(this).attr('uli'));
		});
	});
})(jQuery);
function popup(url, width, height, name)
{
	name =window.open(url, name, 'top=0,left=0,toolbar=0,directories=0,menubar=0,resizable=0,scrollbars=1,width='+width+',height='+height);
	name.focus();
}
function userinfo(user_login_id)
{
	popup('/user/info/'+user_login_id,'440','400','user_info_detail');
}